<%--
  Created by IntelliJ IDEA.
  User: 11954
  Date: 2022/4/19
  Time: 19:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib prefix="C" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>课程列表</title>
</head>
<body>
    <button>添加课程</button>
    <button>删除课程</button>
    <button>修改课程</button>
    <table border="1">
        <tr>
            <th>id</th>
            <th>课程名</th>
        </tr>
        <C:if test="${not empty page.datas}">
            <c:forEach items="${page.datas}" var="course">
                <tr>
                    <td>${course.id}</td>
                    <td>${course.coursename}</td>
                </tr>
            </c:forEach>
        </C:if>
    </table>
    <C:if test="${page.page==1}">
        <a href='coursequerypage?page=1&pagesize=3'>首页</a>
        <a href='coursequerypage?page=${page.page+1}&pagesize=3'>下一页</a>
        <a href='coursequerypage?page=${page.pageCount}&pagesize=3'>尾页</a>
    </C:if>
    <C:if test="${page.page > 1 && page.page<page.pageCount}">
        <a href='coursequerypage?page=1&pagesize=3'>首页</a>
        <a href='coursequerypage?page=${page.page-1}&pagesize=3'>上一页</a>
        <a href='coursequerypage?page=${page.page+1}&pagesize=3'>下一页</a>
        <a href='coursequerypage?page=${page.pageCount}&pagesize=3'>尾页</a>
    </C:if>
    <C:if test="${page.page==page.pageCount}">
        <a href='coursequerypage?page=1&pagesize=3'>首页</a>
        <a href='coursequerypage?page=${page.page-1}&pagesize=3'>上一页</a>
    </C:if>
    <a>第${page.page}页</a>/<a>共${page.pageCount}页</a>
    <a href="index.jsp">返回主页</a>
</body>
</html>
